<!DOCTYPE html>
<html lang="zh-CN">

<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0, maximum-scale=1.0, user-scalable=no">
    <title>易渔商城</title>
    <link href="https://cdnjs.cloudflare.com/ajax/libs/tailwindcss/2.2.19/tailwind.min.css" rel="stylesheet">
    <link href="https://cdnjs.cloudflare.com/ajax/libs/font-awesome/6.0.0-beta3/css/all.min.css" rel="stylesheet">
    <link href="css/style.css" rel="stylesheet">
    <link rel="icon" href="assets/logo/logo.png">
</head>

<body class="bg-gray-100 min-h-screen">
    <div id="particles-js" class="fixed inset-0 z-0"></div>

    <!-- 导航栏 -->
    <nav class="bg-gradient-to-r from-blue-700 to-blue-500 text-white shadow-lg relative z-10">
        <div class="container mx-auto px-4 py-3">
            <div class="flex flex-wrap justify-between items-center">
                <div class="flex items-center">
                    <img src="assets/logo/logo.png" alt="易渔" style="width: 30px;height: 40px;">
                    <a href="index.html" class="text-2xl font-bold">易渔</a>
                </div>
                <div class="hidden md:flex space-x-8 text-lg">
                    <a href="index.html" class="hover:text-blue-200 transition duration-300">首页</a>
                    <a href="forum.html" class="hover:text-blue-200 transition duration-300">论坛</a>
                    <a href="mall.html"
                        class="hover:text-blue-200 transition duration-300 border-b-2 border-white">商城</a>
                    <a href="#" class="hover:text-blue-200 transition duration-300" id="communityBtn">社区活动</a>
                    <a href="#" class="hover:text-blue-200 transition duration-300" id="techniqueBtn">钓技研究</a>
                </div>
                <div class="flex items-center">
                    <a href="cart.html" class="mr-4 relative">
                        <i class="fas fa-shopping-cart text-xl"></i>
                        <span id="cart-count"
                            class="absolute -top-2 -right-2 bg-red-500 text-white rounded-full h-5 w-5 flex items-center justify-center text-xs">0</span>
                    </a>
                    <div id="user-auth-section">
                        <a href="auth.html"
                            class="bg-white text-blue-600 hover:bg-blue-100 px-4 py-2 rounded-lg font-medium transition duration-300">登录/注册</a>
                    </div>
                    <div id="user-info-section" class="hidden">
                        <div class="flex items-center">
                            <img id="user-avatar" src="https://picsum.photos/40/40" alt="用户头像"
                                class="w-8 h-8 rounded-full mr-2">
                            <span id="username" class="font-medium"></span>
                            <button id="logout-btn" class="ml-3 text-sm text-blue-200 hover:text-white">退出</button>
                        </div>
                    </div>
                    <button id="mobile-menu-btn" class="md:hidden ml-4">
                        <i class="fas fa-bars text-2xl"></i>
                    </button>
                </div>
            </div>
            <!-- 移动端菜单 -->
            <div id="mobile-menu" class="hidden md:hidden w-full mt-3">
                <a href="index.html" class="block py-2 hover:bg-blue-600 px-2 rounded">首页</a>
                <a href="forum.html" class="block py-2 hover:bg-blue-600 px-2 rounded">论坛</a>
                <a href="mall.html" class="block py-2 hover:bg-blue-600 px-2 rounded">商城</a>
                <a href="#" class="block py-2 hover:bg-blue-600 px-2 rounded">社区活动</a>
                <a href="#" class="block py-2 hover:bg-blue-600 px-2 rounded">钓技研究</a>
            </div>
        </div>
    </nav>

    <!-- 商城横幅 -->
    <div class="relative bg-cover bg-center h-60 flex items-center justify-center"
        style="background-image: url('https://picsum.photos/1920/1080?fishing=mall');">
        <div class="absolute inset-0 bg-black bg-opacity-50"></div>
        <div class="relative z-10 text-center text-white px-4">
            <h1 class="text-4xl md:text-5xl font-bold mb-4">钓具商城</h1>
            <p class="text-xl md:text-2xl">高品质钓具，专业渔具精选</p>
        </div>
    </div>

    <!-- 商城内容区域 -->
    <div class="container mx-auto px-4 py-8">
        <!-- 商品分类和筛选 -->
        <div class="mb-8 bg-white rounded-lg shadow-md p-4">
            <div class="flex flex-col md:flex-row justify-between items-start md:items-center mb-4">
                <h2 class="text-2xl font-bold text-gray-800 mb-4 md:mb-0">商品分类</h2>
                <div class="flex flex-wrap gap-3">
                    <div class="relative">
                        <select id="sort-order"
                            class="appearance-none px-4 py-2 border border-gray-300 rounded-lg focus:outline-none focus:ring-2 focus:ring-blue-500">
                            <option value="default">默认排序</option>
                            <option value="price-asc">价格从低到高</option>
                            <option value="price-desc">价格从高到低</option>
                            <option value="sales">销量优先</option>
                            <option value="newest">最新上架</option>
                        </select>
                        <div
                            class="pointer-events-none absolute inset-y-0 right-0 flex items-center px-2 text-gray-700">
                            <i class="fas fa-chevron-down"></i>
                        </div>
                    </div>
                    <div class="relative">
                        <input type="text" id="search-products" placeholder="搜索商品..."
                            class="px-4 py-2 border border-gray-300 rounded-lg focus:outline-none focus:ring-2 focus:ring-blue-500">
                        <button id="search-btn"
                            class="absolute right-0 top-0 h-full px-3 text-gray-500 hover:text-blue-600">
                            <i class="fas fa-search"></i>
                        </button>
                    </div>
                </div>
            </div>

            <div class="flex flex-wrap gap-2">
                <a href="#"
                    class="category-btn active px-4 py-2 rounded-full bg-blue-500 text-white hover:bg-blue-600 transition"
                    data-category="all">全部商品</a>
                <a href="#"
                    class="category-btn px-4 py-2 rounded-full bg-gray-200 text-gray-700 hover:bg-blue-500 hover:text-white transition"
                    data-category="rods">鱼竿</a>
                <a href="#"
                    class="category-btn px-4 py-2 rounded-full bg-gray-200 text-gray-700 hover:bg-blue-500 hover:text-white transition"
                    data-category="reels">渔轮</a>
                <a href="#"
                    class="category-btn px-4 py-2 rounded-full bg-gray-200 text-gray-700 hover:bg-blue-500 hover:text-white transition"
                    data-category="lines">鱼线</a>
                <a href="#"
                    class="category-btn px-4 py-2 rounded-full bg-gray-200 text-gray-700 hover:bg-blue-500 hover:text-white transition"
                    data-category="hooks">鱼钩</a>
                <a href="#"
                    class="category-btn px-4 py-2 rounded-full bg-gray-200 text-gray-700 hover:bg-blue-500 hover:text-white transition"
                    data-category="lures">假饵</a>
                <a href="#"
                    class="category-btn px-4 py-2 rounded-full bg-gray-200 text-gray-700 hover:bg-blue-500 hover:text-white transition"
                    data-category="accessories">配件</a>
                <a href="#"
                    class="category-btn px-4 py-2 rounded-full bg-gray-200 text-gray-700 hover:bg-blue-500 hover:text-white transition"
                    data-category="clothing">钓鱼服装</a>
            </div>
        </div>

        <!-- 精选推荐 -->
        <div class="mb-10">
            <h2 class="text-2xl font-bold mb-6 text-gray-800">精选推荐</h2>
            <div class="grid grid-cols-1 sm:grid-cols-2 lg:grid-cols-4 gap-6" id="featured-products">
                <!-- 商品将由JavaScript动态生成 -->
            </div>
        </div>

        <!-- 热销商品 -->
        <div class="mb-10">
            <h2 class="text-2xl font-bold mb-6 text-gray-800">热销商品</h2>
            <div class="grid grid-cols-1 sm:grid-cols-2 lg:grid-cols-4 gap-6" id="hot-products">
                <!-- 商品将由JavaScript动态生成 -->
            </div>
        </div>

        <!-- 全部商品 -->
        <div>
            <h2 class="text-2xl font-bold mb-6 text-gray-800">全部商品</h2>
            <div class="grid grid-cols-1 sm:grid-cols-2 lg:grid-cols-4 gap-6" id="all-products">
                <!-- 商品将由JavaScript动态生成 -->
            </div>

            <!-- 分页 -->
            <div class="mt-8 flex justify-center">
                <nav class="inline-flex rounded-md shadow">
                    <a href="#"
                        class="py-2 px-4 bg-white text-gray-500 hover:text-gray-700 rounded-l-md border border-gray-300">上一页</a>
                    <a href="#" class="py-2 px-4 bg-blue-500 text-white hover:bg-blue-600 border border-blue-500">1</a>
                    <a href="#"
                        class="py-2 px-4 bg-white text-gray-500 hover:text-gray-700 hover:bg-gray-100 border border-gray-300">2</a>
                    <a href="#"
                        class="py-2 px-4 bg-white text-gray-500 hover:text-gray-700 hover:bg-gray-100 border border-gray-300">3</a>
                    <a href="#"
                        class="py-2 px-4 bg-white text-gray-500 hover:text-gray-700 rounded-r-md border border-gray-300">下一页</a>
                </nav>
            </div>
        </div>
    </div>

    <!-- 商品详情模态框 -->
    <div id="product-modal" class="fixed inset-0 bg-black bg-opacity-50 flex items-center justify-center z-50 hidden">
        <div class="bg-white rounded-lg p-6 max-w-4xl w-full mx-4">
            <div class="flex justify-end">
                <button id="close-product-modal" class="text-gray-500 hover:text-gray-700">
                    <i class="fas fa-times text-xl"></i>
                </button>
            </div>
            <div class="flex flex-col md:flex-row">
                <div class="md:w-1/2 pr-0 md:pr-6 mb-4 md:mb-0">
                    <img id="modal-product-image" src="" alt="商品图片" class="w-full h-auto rounded-lg">
                </div>
                <div class="md:w-1/2">
                    <h3 id="modal-product-name" class="text-2xl font-bold mb-2"></h3>
                    <div class="flex items-center mb-2">
                        <div class="flex text-yellow-400 mr-2">
                            <i class="fas fa-star"></i>
                            <i class="fas fa-star"></i>
                            <i class="fas fa-star"></i>
                            <i class="fas fa-star"></i>
                            <i class="fas fa-star-half-alt"></i>
                        </div>
                        <span class="text-gray-600">4.5 (127 评价)</span>
                    </div>
                    <p id="modal-product-price" class="text-2xl text-red-600 font-bold mb-4"></p>
                    <div class="mb-4">
                        <h4 class="font-bold text-gray-700 mb-2">商品描述</h4>
                        <p id="modal-product-desc" class="text-gray-600"></p>
                    </div>
                    <div class="mb-4">
                        <h4 class="font-bold text-gray-700 mb-2">规格选择</h4>
                        <div class="flex flex-wrap gap-2 mb-3">
                            <button
                                class="spec-btn active px-3 py-1 border border-blue-500 bg-blue-50 text-blue-600 rounded-md">标准版</button>
                            <button
                                class="spec-btn px-3 py-1 border border-gray-300 hover:border-blue-500 hover:bg-blue-50 hover:text-blue-600 rounded-md">高级版</button>
                            <button
                                class="spec-btn px-3 py-1 border border-gray-300 hover:border-blue-500 hover:bg-blue-50 hover:text-blue-600 rounded-md">豪华版</button>
                        </div>
                    </div>
                    <div class="mb-6">
                        <h4 class="font-bold text-gray-700 mb-2">数量</h4>
                        <div class="flex items-center">
                            <button id="decrease-quantity"
                                class="px-3 py-1 border border-gray-300 rounded-l-md hover:bg-gray-100">-</button>
                            <input id="product-quantity" type="number" min="1" value="1"
                                class="w-16 px-3 py-1 border-t border-b border-gray-300 text-center focus:outline-none">
                            <button id="increase-quantity"
                                class="px-3 py-1 border border-gray-300 rounded-r-md hover:bg-gray-100">+</button>
                        </div>
                    </div>
                    <div class="flex space-x-4">
                        <button id="add-to-cart-modal"
                            class="flex-1 bg-blue-600 hover:bg-blue-700 text-white py-3 px-4 rounded-lg transition duration-300">
                            <i class="fas fa-shopping-cart mr-2"></i>加入购物车
                        </button>
                        <button id="buy-now"
                            class="flex-1 bg-red-600 hover:bg-red-700 text-white py-3 px-4 rounded-lg transition duration-300">
                            立即购买
                        </button>
                    </div>
                </div>
            </div>
        </div>
    </div>

    <!-- 购物车侧边栏 -->
    <div id="cart-sidebar"
        class="fixed top-0 right-0 w-full md:w-96 h-full bg-white shadow-xl transform translate-x-full transition-transform duration-300 ease-in-out z-50">
        <div class="flex flex-col h-full">
            <div class="flex items-center justify-between p-4 border-b">
                <h3 class="text-xl font-bold">购物车</h3>
                <button id="close-cart-sidebar" class="text-gray-500 hover:text-gray-700">
                    <i class="fas fa-times"></i>
                </button>
            </div>
            <div id="cart-items" class="flex-1 overflow-y-auto p-4">
                <!-- 购物车项目将由JavaScript动态生成 -->
                <div class="text-center text-gray-500 py-10">
                    <i class="fas fa-shopping-cart text-5xl mb-3"></i>
                    <p>您的购物车是空的</p>
                </div>
            </div>
            <div class="border-t p-4">
                <div class="flex justify-between items-center mb-4">
                    <span class="font-bold">总计:</span>
                    <span id="cart-total" class="text-xl font-bold text-red-600">¥0.00</span>
                </div>
                <a href="cart.html"
                    class="block w-full bg-blue-600 hover:bg-blue-700 text-white py-3 text-center rounded-lg transition duration-300">
                    查看购物车
                </a>
            </div>
        </div>
    </div>

    <!-- 通知弹窗 -->
    <div id="notification"
        class="fixed bottom-4 right-4 bg-green-500 text-white p-4 rounded-lg shadow-lg transform translate-y-20 opacity-0 transition-all duration-300 z-50 hidden">
        已添加商品到购物车
    </div>

    <!-- 功能开发中弹窗 -->
    <div id="development-modal"
        class="fixed inset-0 bg-black bg-opacity-50 flex items-center justify-center z-50 hidden">
        <div class="bg-white rounded-lg p-8 max-w-md w-full">
            <div class="text-center">
                <i class="fas fa-code text-4xl text-blue-500 mb-4"></i>
                <h3 class="text-2xl font-bold mb-2">功能开发中</h3>
                <p class="text-gray-600 mb-6">该功能正在积极开发中，敬请期待！</p>
                <button id="close-dev-modal"
                    class="bg-blue-500 hover:bg-blue-600 text-white px-6 py-2 rounded transition duration-300">
                    了解
                </button>
            </div>
        </div>
    </div>

    <!-- 页脚 -->
    <footer class="bg-gray-800 text-white py-8 mt-12">
        <div class="container mx-auto px-4">
            <div class="grid grid-cols-1 md:grid-cols-4 gap-8">
                <div>
                    <h4 class="text-lg font-bold mb-4">关于我们</h4>
                    <p class="text-gray-400">钓鱼天堂是一个致力于为钓鱼爱好者提供交流平台和专业装备的综合性网站。</p>
                </div>
                <div>
                    <h4 class="text-lg font-bold mb-4">快速链接</h4>
                    <ul class="space-y-2 text-gray-400">
                        <li><a href="index.html" class="hover:text-white transition">首页</a></li>
                        <li><a href="forum.html" class="hover:text-white transition">论坛</a></li>
                        <li><a href="mall.html" class="hover:text-white transition">商城</a></li>
                        <li><a href="auth.html" class="hover:text-white transition">注册/登录</a></li>
                    </ul>
                </div>
                <div>
                    <h4 class="text-lg font-bold mb-4">联系我们</h4>
                    <ul class="space-y-2 text-gray-400">
                        <li><i class="fas fa-envelope mr-2"></i> contact@fishingheaven.com</li>
                        <li><i class="fas fa-phone mr-2"></i> 400-123-4567</li>
                        <li><i class="fas fa-map-marker-alt mr-2"></i> 渔乐路88号钓鱼天堂大厦</li>
                    </ul>
                </div>
                <div>
                    <h4 class="text-lg font-bold mb-4">关注我们</h4>
                    <div class="flex space-x-4">
                        <a href="#" class="text-gray-400 hover:text-white text-xl transition"><i
                                class="fab fa-weixin"></i></a>
                        <a href="#" class="text-gray-400 hover:text-white text-xl transition"><i
                                class="fab fa-weibo"></i></a>
                        <a href="#" class="text-gray-400 hover:text-white text-xl transition"><i
                                class="fab fa-qq"></i></a>
                        <a href="#" class="text-gray-400 hover:text-white text-xl transition"><i
                                class="fab fa-tiktok"></i></a>
                    </div>
                    <div class="mt-4">
                        <p class="text-gray-400">订阅我们的钓鱼情报</p>
                        <div class="flex mt-2">
                            <input type="email" placeholder="您的邮箱"
                                class="px-3 py-2 text-gray-800 rounded-l focus:outline-none w-full">
                            <button class="bg-blue-500 hover:bg-blue-600 px-4 py-2 rounded-r transition">订阅</button>
                        </div>
                    </div>
                </div>
            </div>
            <div class="border-t border-gray-700 mt-8 pt-6 text-center text-gray-400">
                <p>&copy; 2025 钓鱼天堂 版权所有 | 钓友们的网上家园</p>
            </div>
        </div>
    </footer>

    <!-- 粒子效果 -->
    <script src="https://cdnjs.cloudflare.com/ajax/libs/particles.js/2.0.0/particles.min.js"></script>
    <script src="js/app.js"></script>
    <script src="js/mall.js"></script>
    <script type="module" src="./js/childJS/mailChild.js"></script>
</body>

</html>